package com.example.hyg_veintype.constant.ble;

import android.content.Context;

import com.example.hyg_veintype.utils.SPUtil;

/**
 * @author: yyw
 * time: 2020/12/14 10:07
 * desc: 记录脉诊本机上次连接过的蓝牙
 */
public class PreBLEConnectedData {

    private static final String LOCAL_BLE_DEVICE = "LOCAL_BLE_DEVICE";

    /**
     * 获取上次连接的蓝牙ID
     *
     * @param context
     * @return
     */
    public static String getLocalBLEDevice(Context context) {
        String deviceStr = (String) SPUtil.get(context, LOCAL_BLE_DEVICE, "");
        return deviceStr;
    }

    /**
     * 设置连接的蓝牙ID
     *
     * @param context
     * @param deviceId
     */
    public static void setConnectedDeviceData(Context context, String deviceId) {
        SPUtil.put(context, LOCAL_BLE_DEVICE, deviceId);
    }

}
